package com.kevin.mybatis.convert;

import com.kevin.mybatis.bean.dto.CarDTO;
import com.kevin.mybatis.bean.dto.DriverDTO;
import com.kevin.mybatis.bean.vo.CarVO;
import com.kevin.mybatis.bean.vo.DriverVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.sql.SQLOutput;

@Mapper
public abstract class CarConvert {

    public static CarConvert INSTANCE = Mappers.getMapper(CarConvert.class);

    /**
     * source 是原对象
     * target 是需要映射到的目标对象
     *
     * @param carDTO
     * @return
     */

   /* @Mappings(
            value = {
                    @Mapping(source = "totalPrice", target = "totalPrice", numberFormat = "#.00"),
                    @Mapping(source = "publishDate", target = "publishDate", dateFormat = "yyyy-MM-dd HH-mm-ss"),
                    @Mapping(target = "color", ignore = true),
                    @Mapping(source = "driverDTO", target = "driverVO")
            }

    )
    public abstract CarVO toCarVO(CarDTO carDTO);*/

    /*@Mapping(source = "id", target = "driverId")
    @Mapping(source = "name", target = "fullName")
    public abstract DriverVO aaaaa(DriverDTO driverDTO);*/

}
